import { Pipe, PipeTransform } from '@angular/core';
import {StaffOnjob} from '../../../model/pages/my-team/team-staff-onjob/team-staff-onjob.model';

/**
 * 在职时间'年'和'月'后添加<br>标签
 */

@Pipe({
    name:'addBrTag'
})

export class AddBrPipe implements PipeTransform {
    transform(arr:string){
        if(/年(?=\d)/.test(arr))
             arr=arr.replace(/年/,'年<br>');
        if(/月(?=\d)/.test(arr))
             arr=arr.replace(/月/,'月<br>');
        return arr;
    }
}